home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
rocket
/
rocket.frm
(
.txt
)
< prev
next >
Wrap
Visual Basic Form
|
1998-03-30
|
8KB
|
247 lines
VERSION 4.00
Begin VB.Form frmrocket
Appearance = 0 'Flat
BackColor = &H00FF0000&
Caption = "Blast Off"
ClientHeight = 4950
ClientLeft = 2115
ClientTop = 1605
ClientWidth = 4020
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 5355
Left = 2055
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4950
ScaleWidth = 4020
Top = 1260
Width = 4140
Begin VB.CommandButton cmdQuit
Caption = "&QUIT"
Height = 495
Left = 3240
TabIndex = 5
Top = 4320
Width = 735
End
Begin VB.CommandButton cmdRight
Caption = "RIGHT"
Height = 495
Left = 120
TabIndex = 4
Top = 1560
Width = 1215
End
Begin VB.CommandButton cmdLeft
Caption = "LEFT"
Height = 495
Left = 120
TabIndex = 3
Top = 840
Width = 1215
End
Begin VB.CommandButton cmdDown
Caption = "DOWN"
Height = 495
Left = 2640
TabIndex = 2
Top = 1560
Width = 1215
End
Begin VB.CommandButton cmdUp
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "UP"
Height = 495
Left = 2640
TabIndex = 1
Top = 840
Width = 1215
End
Begin VB.PictureBox picRocket
Appearance = 0 'Flat
AutoRedraw = -1 'True
AutoSize = -1 'True
BackColor = &H80000005&
DrawStyle = 5 'Transparent
ForeColor = &H80000008&
Height = 510
Left = 1680
Picture = "ROCKET.frx":0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 0
Top = 3600
Width = 510
End
Begin VB.Image imgLogo
Height = 480
Left = 120
Picture = "ROCKET.frx":030A
Top = 4320
Width = 480
End
Begin VB.Label lblAuthor
Alignment = 2 'Center
BackColor = &H000000FF&
Caption = " WRITTEN BY ED HAMMOND "
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 495
Left = 960
TabIndex = 7
Top = 4320
Width = 1695
End
Begin VB.Line linQuitLeft
BorderWidth = 5
X1 = 3120
X2 = 3120
Y1 = 4200
Y2 = 4920
End
Begin VB.Line linQuitTop
BorderWidth = 5
X1 = 3120
X2 = 3960
Y1 = 4200
Y2 = 4200
End
Begin VB.Label lblInstuctions
BackColor = &H000000FF&
Caption = " Press the buttons with the left mouse key to move the rocketship."
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 495
Left = 120
TabIndex = 6
Top = 120
Width = 3735
End
Attribute VB_Name = "frmrocket"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Dim Myup As Integer
Dim Mydown As Integer
Dim Myleft As Integer
Dim Myright As Integer
Dim Mymove As String
Private Sub cmdDown_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Mydown = True
Mymove = down
Mypicturemove
End If
End Sub
Private Sub cmdDown_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Mydown = False
Mypicturemove
End If
End Sub
Private Sub cmdUp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Myup = True
Mymove = up
Mypicturemove
End If
End Sub
Private Sub cmdUp_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Myup = False
Mypicturemove
End If
End Sub
Private Sub cmdLeft_Click()
picRocket.Left = picRocket.Left - 50
End Sub
Private Sub cmdQuit_Click()
CH1_MENU.Show
Unload Me
End Sub
Private Sub cmdRight_Click()
picRocket.Left = picRocket.Left + 50
End Sub
Private Sub Form_Load()
'This centers the form on the screen
frmrocket.Top = (Screen.Height - frmrocket.Height) / 2
frmrocket.Left = (Screen.Width - frmrocket.Width) / 2
End Sub
Public Sub Mypicturemove()
If Mymove = up Then
Do While Myup = True
DoEvents
picRocket.Top = picRocket.Top - 1
Loop
End If
If Mymove = down Then
Do While Mydown = True
DoEvents
picRocket.Top = picRocket.Top + 1
Loop
End If
'ElseIf Mymove = lleft Then
'Do While Myleft = True
'DoEvents
'picRocket.Left = picRocket.Left - 1
'Loop
'ElseIf Mymove = rright Then
'Do While Myright = True
'DoEvents
'picRocket.Left = picRocket.Left + 1
'Loop
'End If
'*************************************************
Select Case Mymove
Case up
Do While Myup = True
DoEvents
picRocket.Top = picRocket.Top - 1
Loop
Case down
Do While Mydown = True
DoEvents
picRocket.Top = picRocket.Top + 1
Loop
'Case lleft
'Do While Myleft = True
'DoEvents
'picRocket.Left = picRocket.Left - 1
'Loop
'Case rright
'Do While Myright = True
'DoEvents
'picRocket.Left = picRocket.Left + 1
'Loop
End Select
End Sub
'*************************************************